<style lang="scss" scoped>
.earnings-info-top {
	background: $themeColor url(../../common/images/newIcon/bg-common.png) no-repeat;
	background-size: 100%;
	// min-height: 150px;
	margin-bottom: 10px;
	text-align: center;
	padding: 40px;
}

.earnings-info-top-title {
	color: #fff;
	margin-top: 10px;
}

.earnings-info-top-number {
	color: #fff;
	margin-top: 10px;
	font-weight: 600;
	font-size: 20px;
}

.u-cell-item__title,
.u-cell-item__value {
	margin-top: 10px;
	margin-bottom: 10px;
}

.value-style {
	margin-left: -50px;
}
/deep/.u-cell__value{
	word-wrap: break-word;
}
</style>
<template>
	<div>
		<div>
			<div class="earnings-info-top">
				<div class="earnings-info-top-title">金额</div>
				<div class="earnings-info-top-number">{{ toFixedNum(customData.amount) }}</div>
			</div>
		</div>

		<div class="earnings-info">
			<u-cell-item  :arrow="false" title="订单号"  :value="customData.orderNo" @click="copy(customData.orderNo)" >
				<template slot="right-icon">
					<span class="iconfont icon-niantie copy"></span>
				</template>
			</u-cell-item>
			<u-cell-item :arrow="false" title="变动金额" :value="'¥' + toFixedNum(customData.amount)" />
			<!-- <u-cell-item :arrow="false" title="到账金额" :value="'¥' + toFixedNum(customData.toAmount)" /> -->
			<!-- <u-cell-item :arrow="false" title="手续费扣费模式" :value="customData.feeDedMode == 0 ? '内扣' : '外扣'" /> -->
			<u-cell-item :arrow="false" title="手续费" :value="toFixedNum(customData.fee) ? toFixedNum(customData.fee) : '-'" />
			<!-- <u-cell-item :arrow="false" title="到账账户" :value="customData.accountNo ? customData.accountNo : '-'" /> -->
			<u-cell-item :arrow="false" title="变动前余额" :value="customData.beforeAmount" />
			<u-cell-item :arrow="false" title="变动后余额" :value="customData.afterAmount" />
			<!-- <u-cell-item :arrow="false" title="提现状态" :value="customData.statusMsg" />
			<u-cell-item :arrow="false" title="提现日期" :value="customData.transDate" /> -->
			<u-cell-item :arrow="false" title="用途备注" :value="customData.remark" />
			<u-cell-item :arrow="false" title="变动日期" :value="customData.addDate" />
			

			<!-- <u-cell-item title="总手续费" :value="customData.totalFee + '%'"  />
      <u-cell-item title="成本价" :value="customData.costFee + '元'"  />-->
		</div>
	</div>
</template>

<script>
import { transInfo, rechargeTransInfo } from '_a/earnings/index';

export default {
	name: 'EarningsInfo',
	components: {},
	data() {
		return {
			customData: {}
		};
	},
	onLoad() {
		let option = this.$storage.getStore('earningsInfo') || {};
		this.customData = option || {};
		// this.$nextTick(() => {
		// 	this.queryMethod();
		// });
	},
	onUnload() {
		this.$storage.removeStore('earningsInfo');
	},
	methods: {
		copy(value) {
			let _this = this;
			uni.setClipboardData({
				data: value,
				success: function() {
					_this.$tip.toast('复制成功!');
				}
			});
		},
		getAmount(query, customData) {
			let num = '';
			if (query.type == 'jinbi') {
				num = this.toFixedNum(customData.amount + customData.randomInter) + ' 积分';
			} else if ((customData.bizType == 7 || customData.bizType == 3 || customData.bizType == 6) && query.type == 'yuer') {
				num = '¥ ' + this.toFixedNum(customData.transAmount);
			} else {
				num = '¥ ' + this.toFixedNum(customData.amount);
			}
			return num;
		},
		queryMethod() {
			// console.log(this.query.type);
			if (this.query.type == 'fenrun') {
				//分润
				transInfo(this.query).then(res => {
					if (res.code === 200) {
						this.customData = res.data;
					}
				});
			} else {
				//奖励列表
				rechargeTransInfo(this.query).then(res => {
					if (res.code === 200) {
						this.customData = res.data;
					}
				});
			}
		}
	}
};
</script>
